/*************************************************************************************************
 * Class to represent an exception thrown when a robot tries to pick a geometric element that
 * does not fit inside its basket. This class inherits Exception. 
 *************************************************************************************************/

package robot;

@SuppressWarnings("serial")
public class ElementTooBigException extends Exception {
	
	// members
	private double elementArea; // area of element that the robot tried to pick
	private double capacityLeft; // capacity left in robot's basket
	
	public ElementTooBigException(double elementArea, double capacityLeft) {
		// set members with given values
		this.elementArea = elementArea;
		this.capacityLeft = capacityLeft;
	}
	
	public String getMessage() {
		return String.format("Cannot add geometric element of size %f into a basket with capacity %f", elementArea, capacityLeft);
	}
	
}
